package tianrun.ziguan.api.calculate.config.dto.response;


import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class AssetCalLabelDetail extends AssetCommonResp {

    private String callabel;

    private List<AssetCalLabelRespDetail> param;

    public String getCallabel() {
        return callabel;
    }

    public void setCallabel(String callabel) {
        this.callabel = callabel;
    }

    public List<AssetCalLabelRespDetail> getParam() {
        return param;
    }

    public void setParam(List<AssetCalLabelRespDetail> param) {
        this.param = param;
    }

    public static AssetCalLabelDetail parse(String assetNum, Map.Entry<String, List<TAssetCalLabelConfigVO>> it) {
        AssetCalLabelDetail assetCalLabelDetail = new AssetCalLabelDetail();
        assetCalLabelDetail.setAssetNum(assetNum);
        assetCalLabelDetail.setParam(it.getValue().stream().map(AssetCalLabelRespDetail::parse).collect(Collectors.toList()));
        assetCalLabelDetail.setCallabel(it.getKey());
        return assetCalLabelDetail;
    }
}
